<?php
/**
 * File : TypeDocument.php
 * Created by Ludovic Reenaers
 * Created on  24 nov. 2010
 * lreenaers@hotmail.com
 */
class TypeDocument{
	private $id;
	private $label;
	private $available;
	private $Entite;
	function __construct($id) {

		if (is_int($id)){
			if($id >= 0){
				$this->id=$id;
			}else{
				throw new FieldFormatException($_SESSION['translator']->idVal);
			}
		}else{
			throw new FieldFormatException($_SESSION['translator']->idInt);
		}
	}
	public function getId(){
		return $this->id;
	}
	public function setLabel($labelstr){
		$this->label = $labelstr;
	}
	public function getLabel(){
		return $this->label;
	}
	public function setAvailable($bool){

		$this->available = $bool;

	}
	public function isAvailable(){
		return $this->available;
	}
	public function setEntite($Entite){
		if(is_a($Entite, 'Entite')){
			$this->Entite = $Entite;
		}else{
			throw new FieldFormatException("Not an entite");
		}
	}
	public function getEntite(){
		return $this->Entite;
	}
}
?>